#include "StdAfx.h"
#include "BorderLayoutApplet.h"

void BorderLayoutApplet::init()
{
	setLayout(new AWTBorderLayout());
	((AWTButton*)add("North", new AWTButton("North")))->addActionListener(this);
	((AWTButton*)add("West", new AWTButton("West")))->addActionListener(this);
	((AWTButton*)add("Center", new AWTButton("Center")))->addActionListener(this);
	((AWTButton*)add("East", new AWTButton("East")))->addActionListener(this);
	((AWTButton*)add("South", new AWTButton("South")))->addActionListener(this);
}

void BorderLayoutApplet::actionPerformed(AWTActionEvent* e)
{
	AfxMessageBox("You clicked " + ((AWTButton*)e->getSource())->getName());
}
